home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2002 June / PC-WELT 6-2002.ISO / js / changecolor.js next >
Encoding:
Text File  |  2002-04-11  |  581 b   |  34 lines

  1. <!--
  2.     var strLastID = "";
  3.     
  4.   function changeColor(cellID, switchOFF) 
  5.   {
  6.         if (document.getElementById)
  7.         {
  8.             if (switchOFF==true) 
  9.             {
  10.                 if (cellID!=strLastID) 
  11.                 {
  12.                     document.getElementById(cellID).style.backgroundColor="#000066";
  13.                 }
  14.             } 
  15.             else 
  16.             {
  17.                 document.getElementById(cellID).style.backgroundColor="#9797FB";
  18.             }
  19.         }
  20.     }
  21.  
  22.     function doClick(id1) 
  23.     {
  24.         var tmpVal = strLastID;
  25.         strLastID = id1;
  26.         if (tmpVal!="") changeColor(tmpVal, true);
  27.         changeColor(id1, false);
  28.     }
  29.  
  30.     function doInit()
  31.     {
  32.         doClick('c10');
  33.     }
  34. //-->